package com.bbcare.followup.plat.service.impl;

import com.bbcare.followup.plat.entity.FuReferralRecord;
import com.bbcare.followup.plat.service.FuReferralRecordService;
import com.bbcare.followup.plat.store.ibatis.FuReferralRecordDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Title		FuReferralRecordServiceImpl.java
 * @Package		com.bbcare.followup.plat.service.impl
 * @Description	患者转诊-申请记录表接口业务实现类
 * @Author		<a href="mailto:jiangqian_java@163.com">jiang</a>
 * @Date		2022/9/16
 * @Version		V1.0 
 * @Copyright	(c) Shanghai BBcare Medical Equipment Co.,Ltd.
 */
@Service
public class FuReferralRecordServiceImpl implements FuReferralRecordService {

    @Resource
    private FuReferralRecordDao fuReferralRecordMapper;


    @Override
    public Object insert(FuReferralRecord fuReferralRecord) {
        return fuReferralRecordMapper.insert(fuReferralRecord);
    }


    @Override
    public Object delete(int id) {
        return fuReferralRecordMapper.delete(id);
    }


    @Override
    public Object update(FuReferralRecord fuReferralRecord) {
        return fuReferralRecordMapper.update(fuReferralRecord);
    }


    @Override
    public FuReferralRecord load(String id) {
        return fuReferralRecordMapper.load(id);
    }


    @Override
    public Map<String,Object> pageList(Map<String, Object> paramMap) {

        HashMap<String, Object> retMap = new HashMap<String, Object>();
        Map<String, Object> qryMapOut = new HashMap<String, Object>();
        qryMapOut.putAll(paramMap);
        List<Map<String, Object>> records = fuReferralRecordMapper.pageList(paramMap);
        retMap.put("total", fuReferralRecordMapper.pageListCount(qryMapOut));
        retMap.put("rows", records);
        return retMap;
    }

    @Override
    public List<Map<String, Object>> selectTenant(Map<String, Object> paramMap) throws Exception{
        return fuReferralRecordMapper.selectTenant(paramMap);
    };

}